<template>
    <div class="">
        <div class="title-row">
            <div class="flex item-center">
                <div class="label-line"></div>
                <span class="title">办证情况</span>

            </div>
            <div class="line"></div>
        </div>
        <ul class="take-content">
            <li v-for="(item,index) in dataList" :key="index" class="take-li">
                <div class="cell-label s-row">
                    <i class="square"></i>
                    <div class="text-over">
                        <span class="db-num">{{item.handleInfo}}</span>
                    </div>
                </div>
                <div class="flex item-center">
                    <div class="bz-num">{{item.amount}}</div>
                    <img :src="getRankStateIcon(item)" alt="">

                </div>
            </li>
            <div v-if="!dataList.length" class="no-data">
                <img src="../../assets/no-data.png" alt="">
            </div>
        </ul>
    </div>
</template>

<script>
const up = require("../../assets/acceptWorkbench/up.png");
const hold = require("../../assets/acceptWorkbench/keep.png");
const down = require("../../assets/acceptWorkbench/down.png");
import { makeTypeRank } from "../../config/api.js";
import Pubsub from "../../utils/pubsub";

export default {
    data() {
        return {
            filter: 1, //1表示累计，2表示今日
            dataList: [],
            rankStateList: { up, hold, down }
        };
    },
    methods: {
        /**
         * 获取rank状态 icon
         */
        getRankStateIcon(item) {
            return this.rankStateList[item.status];
        },
        getList() {
            makeTypeRank({ pageNum: 1, pageSize: 10 }).then((res = {}) => {
                console.log(res);
                this.dataList = res.data || [];
            });
        }
    },
    created() {
        this.getList();
        this.pubsub_token1 = Pubsub.subscribe("MAKE_HANDLE", () => {
            this.getList();
        });
    },
    destroyed() {
        this.pubsub_token1 && Pubsub.unsubscribe(this.pubsub_token1);
    }
};
</script>

<style lang = "scss" scoped>
@import "../../css/unifyAcceptWorkbench.scss";

.take-content {
    margin: 25px 0;
    height: 259px;
    overflow: auto;
    .take-li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 14px;
        &:last-child {
            margin-bottom: 0;
        }
        font-size: 16px;
    }
    .circle {
        height: 4px;
        width: 4px;
        border-radius: 4px;
        background: #000;
        display: block;
        margin-right: 20px;
    }
    .take-num {
        color: #ffaa00;
    }
    .take-time {
        font-size: 18px;
        color: #ffaa00;
        span {
            font-size: 14px;
            color: #888888;
        }
    }
}
.s-row {
    padding-left: 4px;
}
.square {
    height: 13px;
    width: 13px;
    background: #0a1d69;
    transform: rotate(45deg);
    margin-right: 12px;
    display: block;
}
.bz-num {
    width: 62px;
    height: 24px;
    line-height: 24px;
    color: #fff;
    text-align: center;
    background-color: #1a36a9;
    border-radius: 12px;
    margin-right: 10px;
}
</style>